//
//  PhoneAreaTableCell.m
//  objective_c_language
//
//  Created by 王玉龙 on 2018/6/1.
//  Copyright © 2018年 longlong. All rights reserved.
//

#import "PhoneAreaTableCell.h"
#import "PhoneAreaCodeModel.h"
#import <Masonry.h>
@interface PhoneAreaTableCell()
@property (nonatomic ,strong) UILabel *detaileLable;
@end

@implementation PhoneAreaTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        [self.contentView addSubview:self.detaileLable];
        [self.detaileLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.mas_centerY);
            make.right.mas_equalTo(-12);
        }];
    }
    
    return self;
}

- (void)setCodeModel:(PhoneAreaCodeModel *)codeModel
{
    _codeModel = codeModel;
    
    self.textLabel.text = codeModel.countryChinese;
    self.detaileLable.text = codeModel.phoneCode;
}

- (UILabel *)detaileLable
{
    if (_detaileLable == nil)
    {
        _detaileLable = [[UILabel alloc] init];
        _detaileLable.font = [UIFont systemFontOfSize:15];
        _detaileLable.textColor = COLOR_VALUE(0xff5151, 1);
    }
    return _detaileLable;
}

@end
